import React, { PureComponent } from 'react'
import { Link, Outlet } from 'react-router-dom'
import  withRouter from '../hoc/withRouter.js'

export class Home extends PureComponent {
  navigateTo(path){
    const { router } = this.props
    console.log(router)
    router.navigate(path)
  }
  render() {
    return (
      <div>
        <h3>Home Page</h3>
        <Link to='/home/banner'>banner</Link>
        <span>|</span>
        <Link to="/home/content">content</Link>
        <span>|</span>
        <button onClick={() => this.navigateTo('/home/category')}>分类</button>
        <Outlet></Outlet>
      </div>
    )
  }
}



export default withRouter(Home)